package cn.yx.framework.exception;

import java.util.HashMap;

/**
 * @author ZHUL
 * @version V1.0
 * @Title: PermissionException
 * @Package cn.yx.framework.exception
 * @Description: ${todo}
 * @date 2017-02-10 13:03
 */
public class PermissionException extends BasicException {
    private static final int CODE_PERMISSION_EXCEPTION = 5403;
    private String ip;
    private String path;
    private String method;
    private String platform;

    public PermissionException(String path, String method) {
        this("访问权限异常", "", path, method, "");
    }

    public PermissionException(String message, String ip, String path, String method, String platform) {
        super(5403, message);
        this.ip = ip;
        this.path = path;
        this.method = method;
        this.platform = platform;
    }

    protected Object getData() {
        return new HashMap() {
            {
                this.put("ip", PermissionException.this.ip);
                this.put("path", PermissionException.this.path);
                this.put("method", PermissionException.this.method);
                this.put("platform", PermissionException.this.platform);
            }
        };
    }
}
